<!--
  Generated template for the CustomerManagePage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar>
    <ion-title>{{"CUSTOMER_TITLE" | translate}}</ion-title>
  </ion-navbar>

</ion-header>


<ion-content>
  <ion-fab bottom right>
    <button ion-fab color="danger" (click)="addCustomer()">
      <ion-icon name="add"></ion-icon>
    </button>
  </ion-fab>

  <div [hidden]="pages.length" style="margin: 0 auto;padding-top: 10%;width: 60%;">
    <ion-note>
      还没有客户! 快去创建客户吧😊
    </ion-note>
  </div>

  <ion-list>
    <ion-item-sliding *ngFor="let customer of pages;">
      <ion-item (click)="editCustomer(customer)">
        <ion-avatar item-start>
          <img src="http://ojg32ej8x.bkt.clouddn.com/pilotGame/file/mv">
        </ion-avatar>
        <h5>{{customer.accountName}}</h5>
      </ion-item>
      <ion-item-options>
        <button ion-button color="primary" icon-start (click)="deleteCustomer(customer)">
          <ion-icon name="trash"></ion-icon>
          删除
        </button>
        <button ion-button color="secondary" icon-start (click)="editCustomer(customer)">
          <ion-icon name="create"></ion-icon>
          编辑
        </button>
      </ion-item-options>
    </ion-item-sliding>
  </ion-list>
  <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
    <ion-infinite-scroll-content
      loadingSpinner="bubbles"
      loadingText="{{'LOADING_TEXT' | translate}}">
    </ion-infinite-scroll-content>
  </ion-infinite-scroll>
</ion-content>
